/**
 * 根据vuex缓存中的权限值判断是否有权限值
 * 例: 350 - 道路测试
 * @param {string or array} auths
 */
export function hasAuthTree(auths) {
  if (!auths) return false;
  let bool = false;
  let arr = [];
  if (typeof auths == 'string') {
    arr.push(auths);
  }
  if (Array.isArray(auths)) {
    arr = auths;
  }
  arr.forEach(item => {
    let account = JSON.parse(sessionStorage.getItem('account'));
    let authList = account ? account.authIds : [];
    // if (store.state.global.authorities.has(String(item))) {
    if (authList && authList.indexOf(String(item)) !== -1) {
      bool = true;
    }
  });
  return bool;
}
